﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JXT.PrimaryKey.Batman.Domain.Models;

namespace JXT.PrimaryKey.Batman.Domain.Specifications
{
    /// <summary>
    /// 查询对象工厂
    /// </summary>
    public interface ISpecificationFactory
    {
        /// <summary>
        /// 创建基本查询对象
        /// </summary>
        /// <typeparam name="TEntity">模型类型</typeparam>
        /// <returns>查询对象</returns>
        ISpecification<TEntity> CreateSpecification<TEntity>() where TEntity : IEntity;

        /// <summary>
        /// 创建包含排序要求的查询对象
        /// </summary>
        /// <typeparam name="TEntity">模型类型</typeparam>
        /// <returns>查询对象</returns>
        IOrderedSpecification<TEntity> CreateOrderedSpecification<TEntity>() where TEntity : IEntity;

        /// <summary>
        /// 创建包含分页要求的查询对象
        /// </summary>
        /// <typeparam name="TEntity">模型类型</typeparam>
        /// <returns>查询对象</returns>
        IPagedSpecification<TEntity> CreatePagedSpecification<TEntity>() where TEntity : IEntity;
    }
}
